<?php


class Device extends CActiveRecord
{
    public $Vzdmx1mdrg1b;
    public $Vijd5ggqhnpb;
    
    public static function model($Vgmajjibziuy=__CLASS__)
    {
        return parent::model($Vgmajjibziuy);
    }

    
    public function tableName()
    {
        return 'device';
    }

    
    public function rules()
    {
        
        
        return array(
            array('subscriber_id, device_type, app_version_code', 'numerical', 'integerOnly'=>true),
            array('device_id', 'length', 'max'=>150),
            array('device_token', 'length', 'max'=>250),
            array('os_version', 'length', 'max'=>20),
            array('note', 'length', 'max'=>300),
            array('create_date, modify_date', 'safe'),
            
            
            array('id, device_id, device_token, subscriber_id, device_type, os_version, app_version_code, create_date, modify_date, note', 'safe', 'on'=>'search'),
        );
    }

    
    public function relations()
    {
        
        
        return array(
            'subscriber' => array(self::BELONGS_TO, 'Subscriber', 'subscriber_id'),
        );
    }

    
    public function attributeLabels()
    {
        return array(
            'id' => 'ID',
            'device_id' => 'Device',
            'device_token' => 'Device Token',
            'subscriber_id' => 'Subscriber',
            'device_type' => 'Type (1-Android, 2-iOS)',
            'os_version' => 'Os Version',
            'app_version_code' => 'App Version Code',
            'create_date' => 'Create Date',
            'modify_date' => 'Modify Date',
            'note' => 'Note',
            'selected'=>'Selected',
        );
    }

    
    public function search()
    {
        
        

        $V0v5vsnfxezw=new CDbCriteria;

        $V0v5vsnfxezw->compare('id',$this->id);
        $V0v5vsnfxezw->compare('device_id',$this->device_id,true);
        $V0v5vsnfxezw->compare('device_token',$this->device_token,true);
        $V0v5vsnfxezw->compare('subscriber_id',$this->subscriber_id);
        $V0v5vsnfxezw->compare('device_type',$this->device_type);
        $V0v5vsnfxezw->compare('os_version',$this->os_version,true);
        $V0v5vsnfxezw->compare('app_version_code',$this->app_version_code);
        $V0v5vsnfxezw->compare('create_date',$this->create_date,true);
        $V0v5vsnfxezw->compare('modify_date',$this->modify_date,true);
        $V0v5vsnfxezw->compare('note',$this->note,true);

        return new CActiveDataProvider($this, array(
            'criteria'=>$V0v5vsnfxezw,
        ));
    }
}